<?php
//$Id: global.php 9 2009-04-26 06:35:12Z bole.Chen $
require 'config.php';

define ('DS', DIRECTORY_SEPARATOR);
define ('ROOT', dirname(__FILE__).DS);
define ('LIBS', ROOT.'includes'.DS);
define ('CTLS', ROOT.'controllers'.DS);
define ('MODELS', ROOT.'models'.DS);

@$_SERVER['PATH_INFO'] = isset($_SERVER['ORIG_PATH_INFO']) ? $_SERVER['ORIG_PATH_INFO'] : $_SERVER['PATH_INFO'];

//Loads component/components from LIBS.
function uses () {
    $args = func_get_args();
    foreach ($args as $arg) require_once (LIBS.strtolower($arg).'.php');
}

//Start the SESSION
@session_start();

//Keep 3days cookie for Guest
if (!isset($_COOKIE['_cfguest'])) {
    setcookie(session_name(), session_id(), time()+3600*24*3);
    setcookie('_cfguest', 1, time()+3600*12);
}

uses('config','Object','Controller','Functions');

define ('VIEWS', ROOT.'views'.DS);

require_once ROOT.'plugins'.DS.'vip.php';
require_once ROOT.'plugins'.DS.'freeship.php';

//load_plugins('2006ye'); 会有 global 变量问题
//require_once ROOT.'plugins'.DS.'agentsell.php';
//require_once ROOT.'plugins'.DS.'hello.php';
//require_once ROOT.'plugins'.DS.'2006ye.php';
//require_once ROOT.'plugins'.DS.'2007xms.php';

//店休
//require_once ROOT.'plugins'.DS.'rest.php';
?>
